package com.wenhao.leetcode.easy;

/**
 * 题目：https://leetcode-cn.com/problems/climbing-stairs/
 * 爬楼梯
 *
 * 非常显然的斐波那契数列
 *
 * @author Wenhao Tong
 * @Description
 * @create 2021-07-08 23:21
 */
public class LeetCode70 {
    public static void main(String[] args) {
        LeetCode70 leetCode70 = new LeetCode70();
        int i = leetCode70.climbStairs(4);
        System.out.println(i);

    }
    public int climbStairs(int n) {
        int a = 1;
        int b = 0;
        for (int i = 0;i < n;i++) {
            a = a + b;
            b = a - b;
        }
        return a;
    }
}
